﻿@using DirectSell.Model.User
@using Webdiyer.WebControls.Mvc;
@model PagedList<UserUpgrade>
@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Manager/Views/Shared/ManagerLayout.cshtml";
}
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户中心 <span class="c-gray en">&gt;</span> 用户管理
     <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="#" onclick='$("#searchForm").submit();' title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    @using (Ajax.BeginForm("Index", new RouteValueDictionary { { "id", "" } }, new AjaxOptions { UpdateTargetId = "articles", InsertionMode = InsertionMode.Replace }, new RouteValueDictionary { { "id", "searchForm" } }))
    {
        <div class="text-c">
            日期范围：
            <input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}' })" id="datemin" name="startTime" class="input-text Wdate" style="width:120px;">
            -
            <input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d' })" id="datemax" name="endTime" class="input-text Wdate" style="width:120px;">
            <input type="text" class="input-text" style="width:250px" placeholder="输入会员名称、电话、编号" id="" name="SerachCondition">
            <button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜用户</button>
        </div>
    }
    <div class="mt-20" style="text-align:center">
        <div id="articles">
            @Html.Partial("_AjaxSearchPost", Model)
        </div>
    </div>
</div>
@section Scripts
{
    @{Html.RegisterMvcPagerScriptResource();}
}
<script>
    //同意
    function Agree(Id, Level, Type,UserCode) {
        //询问框
        layer.confirm('确定同意该升级申请？', {
            btn: ['确定', '取消'] //按钮
        }, function () {
            //加载层
            var index = layer.load(1, {
                shade: [0.1, '#fff']
            });
            $.ajax({
                type: "post",
                url: "/BackUpgradeAudit/Audit",
                data: { Id: Id, Level: Level, Type: Type, UserCode: UserCode },
            }).success(function (message) {
                layer.msg('升级成功', { icon: 1 });
                $("#searchForm").submit();
            }).fail(function (err) {
                layer.msg('系统错误,请稍后重试', { icon: 2 });
            })
            layer.close(index)//关闭加载层
        });
    }
    //拒绝
    function Refuse(Id, Level, Type, UserCode) {
        //询问框
        layer.confirm('确定拒绝该升级申请？', {
            btn: ['确定', '取消'] //按钮
        }, function () {
            //加载层
            var index = layer.load(1, {
                shade: [0.1, '#fff']
            });
            $.ajax({
                type: "post",
                url: "/BackUpgradeAudit/Audit",
                data: { Id: Id, Level: Level, Type: Type, UserCode: UserCode },
            }).success(function (message) {
                layer.msg('拒绝成功', { icon: 1 });
                $("#searchForm").submit();
            }).fail(function (err) {
                layer.msg('系统错误,请稍后重试', { icon: 2 });
            })
            layer.close(index)//关闭加载层
        });
    }
    /*用户-查看*/
    function member_show(title, url, id, w, h) {
        layer_show(title, url, w, h);
    }
</script>
